package com.example.a10908.retorfitrxjava.utils;

import com.example.a10908.retorfitrxjava.callback.LoginCallBack;
import com.example.a10908.retorfitrxjava.model.bean.LoginBean;

/**
 * Created by 10908 on 2016/12/16.
 * 单例模式
 */

public class LoginUtils {
    private static LoginUtils loginUtils;
    private LoginCallBack loginCallBack;

    public void setPresenter_login(LoginCallBack loginCallBack) {
        this.loginCallBack=loginCallBack;
    }

    public static LoginUtils getLoginUtils() {
        if (loginUtils == null) {
            loginUtils = new LoginUtils();
        }
        return loginUtils;
    }

    public void LoginState(String name, String password) {
        if (name.equals("lfx") && password.equals("123456")){
            loginCallBack.getLoginCallBack(new LoginBean("OK"));
        }else {
            loginCallBack.getLoginCallBack(new LoginBean("NO"));
        }

    }
}
